package com.ruoyi.system.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.util.Date;

/**
 * 帖子评论对象 postComments
 *
 * @author zrj
 * @date 2025-07-15
 */
public class PostComments extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 帖子评论主键 */
    @JsonSerialize(using = ToStringSerializer.class) // 防止前端 Long 精度丢失
    private Long postCommentId;

    /** 被评论的帖子id */
    @Excel(name = "被评论的帖子ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long postId;

    /** 父评论id（空为顶层） */
    @Excel(name = "父评论ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentCommentId;

    /** 评论人id（关联用户表） */
    @Excel(name = "评论人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /** 评论人姓名（非数据库字段，用于显示） */
    @Excel(name = "评论人姓名")
    private String userName; // 非数据库字段，需要在查询时手动赋值

    /** 评论内容 */
    @Excel(name = "评论内容")
    private String content;

    /** 评论图片（JSON数组格式存储多个URL） */
    @Excel(name = "评论图片")
    private String images;

    public void setPostCommentId(Long postCommentId)
    {
        this.postCommentId = postCommentId;
    }

    public Long getPostCommentId()
    {
        return postCommentId;
    }

    public void setPostId(Long postId)
    {
        this.postId = postId;
    }

    public Long getPostId()
    {
        return postId;
    }

    public void setParentCommentId(Long parentCommentId)
    {
        this.parentCommentId = parentCommentId;
    }

    public Long getParentCommentId()
    {
        return parentCommentId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public String getContent()
    {
        return content;
    }

    public void setImages(String images)
    {
        this.images = images;
    }

    public String getImages()
    {
        return images;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("postCommentId", getPostCommentId())
                .append("postId", getPostId())
                .append("parentCommentId", getParentCommentId())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("content", getContent())
                .append("images", getImages())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}